package com.meowcook.service;

import com.meowcook.pojo.dto.RecipeAddDTO;
import com.meowcook.pojo.dto.RecipeUpdateDTO;
import com.meowcook.pojo.vo.RecipeDetailVO;
import com.meowcook.pojo.vo.RecipePartIVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 28792
 * Date: 2025-05-03
 * Time: 19:10
 */
public interface IRecipeService {
    /**
     * 创建菜谱
     * @param recipeAddDTO 菜谱信息
     */
    @Transactional
    void createOneRecipe(RecipeAddDTO recipeAddDTO, Long userId);

    /**
     * 根据板块id查询食谱列表
     * @param boardId 板块id
     * @return List<Recipe>
     */
    List<RecipePartIVO> selectByBoardId(Long boardId, Integer offset, Integer limit);

    /**
     * 根据食谱id查询食谱详情
     * @param recipeId 食谱id
     * @return RecipeDetailVO
     */
    RecipeDetailVO selectDetailByRecipeId(Long recipeId);

    /**
     * 修改食谱
     * @param recipeUpdateDTO 要修改的食谱信息
     */
    @Transactional
    void updateRecipe(RecipeUpdateDTO recipeUpdateDTO);

    /**
     *删除食谱
     * @param recipeId 要删除的食谱ID
     */
    @Transactional
    void deleteRecipe(Long recipeId);

    /**
     * 获取用户发布食谱列表
     * @param userId 用户Id
     * @return List<RecipePartIVO>
     */
    List<RecipePartIVO> selectByUserId(Long userId, Integer offset, Integer limit);

    /**
     * 获取收藏食谱
     * @param userId 用户Id
     * @return List<RecipePartIVO>
     */
    List<RecipePartIVO> selectCollectionByUserId(Long userId, Integer offset, Integer limit, Integer blocked);

}
